﻿namespace HRM.CORE
{
    using DevExpress.XtraEditors;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;

    public class xfmTimekeeperTotal : XtraForm
    {
        private IContainer components = null;
        public static HRM.CORE.xucTimekeeperTotal xucTimekeeperTotal;

        public event ClosedHandler Closed;

        public event TimekeeperTableDeletedHandler TimekeeperTableDeleted;

        public event TimekeeperTableInsertedHandler TimekeeperTableInserted;

        public event UnShiftDataHandler UnShiftData;

        public xfmTimekeeperTotal()
        {
            this.InitializeComponent();
            base.Load += new EventHandler(this.xfmTimekeeperTotal_Load);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x284, 0x1b2);
            base.Name = "xfmTimekeeperTotal";
            this.Text = "Tổng Hợp Ng\x00e0y C\x00f4ng";
            base.ResumeLayout(false);
        }

        public void LoadTimekeeperTableList()
        {
            xucTimekeeperTotal.LoadTimeKeeperTableList();
        }

        private void RaiseClosedHandler()
        {
            if (this.Closed != null)
            {
                this.Closed(this);
            }
        }

        private void RaiseTimekeeperTableDeletedHander()
        {
            if (this.TimekeeperTableDeleted != null)
            {
                this.TimekeeperTableDeleted(this);
            }
        }

        private void RaiseTimekeeperTableInsertedHander()
        {
            if (this.TimekeeperTableInserted != null)
            {
                this.TimekeeperTableInserted(this);
            }
        }

        private void RaiseUnShiftDataHandler(int Month, int Year)
        {
            if (this.UnShiftData != null)
            {
                this.UnShiftData(this, Month, Year);
            }
        }

        private void xfmTimekeeperTotal_Load(object sender, EventArgs e)
        {
            xucTimekeeperTotal = new HRM.CORE.xucTimekeeperTotal();
            xucTimekeeperTotal.Closed += new HRM.CORE.xucTimekeeperTotal.ClosedHandler(this.xucTimekeeperTotal_Closed);
            xucTimekeeperTotal.UnShiftData += (s, m, y) => this.RaiseUnShiftDataHandler(m, y);
            xucTimekeeperTotal.TimekeeperTableDeleted += s => this.RaiseTimekeeperTableDeletedHander();
            xucTimekeeperTotal.Dock = DockStyle.Fill;
            base.Controls.Add(xucTimekeeperTotal);
        }

        private void xucTimekeeperTotal_Closed(object sender)
        {
            base.Close();
        }

        public delegate void ClosedHandler(object sender);

        public delegate void TimekeeperTableDeletedHandler(object sender);

        public delegate void TimekeeperTableInsertedHandler(object sender);

        public delegate void UnShiftDataHandler(object sender, int Month, int Year);
    }
}

